package com.fan.teamer.service;

import java.util.List;

import javax.inject.Inject;
import javax.inject.Named;

import org.springframework.transaction.annotation.Transactional;

import com.fan.teamer.model.dao.RoleDao;
import com.fan.teamer.model.domain.Role;

@Named("roleService")
@Transactional(readOnly = true)
public class RoleServiceImpl implements RoleService {

	@Inject
	@Named("roleDao")
	private RoleDao roleDao;

	public RoleDao getRoleDao() {
		return roleDao;
	}

	public void setRoleDao(RoleDao roleDao) {
		this.roleDao = roleDao;
	}

	@Override
	public Role getRole(String email) {
		return roleDao.getRole(email);
	}

	@Override
	public List<Role> getAllRoles() {
		return roleDao.getAllRoles();
	}

	@Override
	public int getSize() {
		return roleDao.getSize();
	}

	@Override
	@Transactional(readOnly = false)
	public void addRole(Role role) {
		roleDao.addRole(role);
	}

	@Override
	@Transactional(readOnly = false)
	public void updateStock(Role role) {
		roleDao.updateStock(role);
	}

	@Override
	@Transactional(readOnly = false)
	public void deleteRole(Role role) {
		roleDao.deleteRole(role);
	}

	@Override
	public boolean hasRole(String email) {
		return roleDao.hasRole(email);
	}

	@Override
	public List<String> getColumnNames() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String getUserGroup(String email) {
		// TODO Auto-generated method stub
		return null;
	}

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub

	}

}
